package club.tianff.util;

import club.tianff.util.restapiresponse.ResponseEnum;

/**
 * Created by tianfei on 2017/8/18.
 */
public class RestApiException extends RuntimeException {

    private Integer code;

    //只提供message的构造方法，返回-1状态码
    public RestApiException(String message){
        super(message);
        this.code=-1;
    }


    public RestApiException(ResponseEnum mEnum) {
        super(mEnum.getMsg());
        this.code = mEnum.getCode();
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }


}
